﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SISGEZATBZVisual.BusinessEntities;

namespace SISGEZATBZVisual.Repository.Mapping
{
    public class TipoPagoMap:EntityTypeConfiguration<TipoPago>
    {
        public TipoPagoMap()
        {
            this.HasKey(r => r.Id);

            //propiedades
            this.Property(r => r.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(r => r.NombrePago)
                .IsRequired()
                .HasMaxLength(70);

            this.Property(r => r.Monto)
               .IsRequired();

            this.Property(c => c.Descripcion)
            .HasMaxLength(255)
            .IsOptional();

            this.Property(r => r.EsObligatorio)
            .IsRequired();

            //table
            this.ToTable("Tipo de Pago");

            //Relaciones

        }
    }
}
